feat(cli): added Ctrl+Z (SIGTSTP) support #2836
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes one entry from #2788 (comment) by adding support for Ctrl+Z. I did face a few problems. But overall it works.
It adds
(signal)
to the zsh's suspend job log message, which isn't there when SIGTSTP is used in other programs. Another thing is that when it is stopped in the middle of some building process (at least during Wasm shenanigans) it can ruin the build (with a panic message) and thedx serve
must be restarted. This should be explored more because suspending shouldn't break anything ideally.The quirk that is interesting is where the execution is continued. This is nice to know as I used a condition check in the main loop before and didn't understand why no logs from it showed up. The less code, the cleaner it gets!
It looks like there is only 1 new package according to
Cargo.lock
. Nice.I added a few notes in different places. Like using private field from
screen
variable isn't great.